package com.xiaoc.bulldozer.common.service.impl;

import com.xiaoc.bulldozer.common.AccountBalanceConstant;
import com.xiaoc.bulldozer.common.dao.AwardStatisticsMapper;
import com.xiaoc.bulldozer.common.dto.AwardStatisticsDto;
import com.xiaoc.bulldozer.common.dto.AwardStatisticsQueryDto;
import com.xiaoc.bulldozer.common.service.AwardStatisticsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Set;

/**
 * describe:
 *
 * @author lihuancheng
 * @date 2018/9/21
 */
@Service("awardStatisticsService")
public class AwardStatisticsServiceImpl implements AwardStatisticsService {

    @Resource
    private AwardStatisticsMapper awardStatisticsMapper;

    @Override
    public Integer getAwardCount(AwardStatisticsQueryDto awardStatisticsQueryDto) {
        return awardStatisticsMapper.getAwardCount(awardStatisticsQueryDto);
    }

    @Override
    public List<AwardStatisticsDto> getAwardListByCondition(AwardStatisticsQueryDto awardStatisticsQueryDto) {
        return awardStatisticsMapper.getAwardListByCondition(awardStatisticsQueryDto);
    }

    @Override
    public Integer queryAwardCountByUserIdAndStatus(Integer userId, Integer status) {
        return awardStatisticsMapper.queryAwardCountByUserIdAndStatus(userId, status);
    }

    @Override
    public Integer queryOpenAwardCountByUserId(Integer userId) {
        return awardStatisticsMapper.queryOpenAwardCountByUserId(userId);
    }

    @Override
    public Integer sumAwardFeeByUserIdAndStatus(Integer userId, Integer status) {
        return awardStatisticsMapper.sumAwardFeeByUserIdAndStatus(userId, status);
    }

    @Override
    public Integer sumAwardOutFeeByUserIdAndType(Integer userId, Integer type) {
        return awardStatisticsMapper.sumAwardOutFeeByUserIdAndType(userId, type, AccountBalanceConstant.ACCOUNT_BALANCE_TYPE_MARKET);
    }

    @Override
    public List<AwardStatisticsDto> queryOpenAwardCountByUserIdList(Set<Integer> userIdList) {
        return awardStatisticsMapper.queryOpenAwardCountByUserIdList(userIdList);
    }

    @Override
    public List<AwardStatisticsDto> queryGetAwardCountByUserIdListAndStatus(Set<Integer> userIdList, Integer status) {
        return awardStatisticsMapper.queryGetAwardCountByUserIdListAndStatus(userIdList, status);
    }

    @Override
    public List<AwardStatisticsDto> sumAwardFeeByUserIdListAndStatus(Set<Integer> userIdList, Integer status) {
        return awardStatisticsMapper.sumAwardFeeByUserIdListAndStatus(userIdList, status);
    }

    @Override
    public List<AwardStatisticsDto> sumAwardOutFeeByUserIdListAndType(Set<Integer> userIdList, Integer type) {
        return awardStatisticsMapper.sumAwardOutFeeByUserIdListAndType(userIdList, type, AccountBalanceConstant.ACCOUNT_BALANCE_TYPE_MARKET);
    }

    @Override
    public List<AwardStatisticsDto> queryGetAwardCount(AwardStatisticsQueryDto queryDto) {
        return awardStatisticsMapper.queryGetAwardCount(queryDto);
    }

    @Override
    public List<AwardStatisticsDto> queryOpenAwardCount(AwardStatisticsQueryDto queryDto) {
        return awardStatisticsMapper.queryOpenAwardCount(queryDto);
    }

    @Override
    public List<AwardStatisticsDto> queryOpenAwardPersonCount(AwardStatisticsQueryDto queryDto) {
        return awardStatisticsMapper.queryOpenAwardPersonCount(queryDto);
    }

    @Override
    public List<AwardStatisticsDto> queryGetAwardSumFee(AwardStatisticsQueryDto queryDto) {
        return awardStatisticsMapper.queryGetAwardSumFee(queryDto);
    }

    @Override
    public List<AwardStatisticsDto> queryGetAwardPersonCount(AwardStatisticsQueryDto queryDto) {
        return awardStatisticsMapper.queryGetAwardPersonCount(queryDto);
    }

    @Override
    public List<AwardStatisticsDto> queryAwardOutSumFee(AwardStatisticsQueryDto queryDto) {
        return awardStatisticsMapper.queryAwardOutSumFee(queryDto);
    }

    @Override
    public List<AwardStatisticsDto> queryAwardOutPersonCount(AwardStatisticsQueryDto queryDto) {
        return awardStatisticsMapper.queryAwardOutPersonCount(queryDto);
    }
}
